import React, { PureComponent } from 'react'
import { Select,Checkbox} from 'antd';
import { isLianxi } from '@/utils/utils'
export class QuestionTypeSelect extends PureComponent<any, any> {
    onChange=(e:any)=>{
        this.props.onChange?this.props.onChange(e):''
    }
    render() {
        const { isModal ,value,readOnly} = this.props;
        return (
            <Select style={{ width: '100%', minWidth: 120 }} disabled={readOnly} placeholder="请选择题型" value={value} onChange={this.onChange}>
                {
                    !isModal && <Select.Option key="" value="">所有题型</Select.Option>
                }
                <Select.Option key="1" value="1">单选题</Select.Option>
                {
                    !isLianxi()&&<Select.Option key="2" value="2">多选题</Select.Option>
                }
                <Select.Option key="3" value="3">判断题</Select.Option>
                {/* <Select.Option key="4" value="4">填空题</Select.Option>
                <Select.Option key="5" value="5">简答题</Select.Option>
                <Select.Option key="6" value="6">作文题</Select.Option>
                <Select.Option key="7" value="7">论述题</Select.Option>
                <Select.Option key="8" value="8">分析题</Select.Option>
                <Select.Option key="9" value="9">操作题</Select.Option>
                <Select.Option key="10" value="10">综合题</Select.Option> */}
            </Select>
        )
    }
}
export class HardLevel extends PureComponent<any, any> {
    onChange=(e:any)=>{
         this.props.onChange?this.props.onChange(e):''
    }
    render() {
        const { isModal,value } = this.props;
        return (
            <Select style={{ width: '100%', minWidth: 120 }} placeholder="请选择难度" onChange={this.onChange} value={value+''}>
                {
                    !isModal && <Select.Option key=""value="">所有难度</Select.Option>
                }
                <Select.Option key="1" value="1">容易</Select.Option>
                <Select.Option key="2" value="2">较易</Select.Option>
                <Select.Option key="3" value="3">中等</Select.Option>
                <Select.Option key="4" value="4">较难</Select.Option>
                <Select.Option key="5" value="5">难</Select.Option>
            </Select>
        )
    }
}
export class QuestionBankCheckbox extends PureComponent<any, any> {
    onChange=(e:any)=>{
         this.props.onChange?this.props.onChange(e):''
    }
    render() {
        const { value} = this.props;
        return (
            <Checkbox.Group style={{ width: '100%'}}  onChange={this.onChange} value={value}>
                <Checkbox key="3" value="3">模拟题库</Checkbox>
                <Checkbox key="2" value="2">练习题库</Checkbox>
                <Checkbox key="1" value="1">正式题库</Checkbox>
                {/* <Checkbox key="4" value="4">每日一题</Checkbox> */}
            </Checkbox.Group>
        )
    }
}

export class QuestionBankSelect extends PureComponent<any, any> {
    onChange=(e:any)=>{
        this.props.onChange(e)
    }
    render() {
        const { isModal,value} = this.props;
        return (
            <Select style={{ width: '100%', minWidth: 120 }} placeholder="请选择题库" onChange={this.onChange} value={value}>
                {
                    !isModal && <Select.Option key="" value="">所有题库</Select.Option>
                }
                <Select.Option key="3" value="3">模拟题库</Select.Option>
                <Select.Option key="2" value="2">练习题库</Select.Option>
                <Select.Option key="1" value="1">正式题库</Select.Option>
                {/* <Select.Option key="4" value="4">每日一题</Select.Option> */}
            </Select>
        )
    }
}
